package com.example.quiz.dao;

import com.example.quiz.model.User;
import org.apache.ibatis.annotations.Param;
import java.util.List;

public interface UserMapper {
    int insert(User user);

    User selectByUsername(String username);

    User selectById(Long id);

    List<User> selectAll();

    int update(User user);

    int deleteById(Long id);

    int updatePassword(@Param("userId") Long userId,
            @Param("oldPassword") String oldPassword,
            @Param("newPassword") String newPassword);

    List<User> selectPagedUsers(@Param("offset") int offset, @Param("limit") int limit);

    int selectTotalCount();

    int updateRole(@Param("id") Long id, @Param("role") String role);
}